package com.c.ctgproject.retrofit;

import com.c.ctgproject.mode.Recheck;
import com.c.ctgproject.mode.StorageVehicles;
import com.c.ctgproject.mode.User;
import com.c.ctgproject.mode.VehicleInspection;
import com.c.ctgproject.mode.VehicleLocation;
import com.c.ctgproject.mode.carEntrance;

import java.util.ArrayList;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

public interface Service {
    //登录
    @POST("/center/user/login")
    Observable<Response<User>> loginpass(@Body RequestBody Body);

    //新建车辆
    @Multipart
    @POST("/plant/archive/addEntranceCar")
    Observable<Response> addEntranceCar(@Header("token") String token, @Part ArrayList<MultipartBody.Part> file);

    //车牌识别
    @POST("/plant/ocr/car/licensePlate")
    @FormUrlEncoded
    Observable<Response> licensePlate(@Header("token") String token, @Field("imageBase64") String imageBase64);

    //    @Field("oldPassword")oldPassword:String
    //    Observable<Response> licensePlate(@Header("token") String token, @Part MultipartBody.Part file);
    //按车牌获取待初验车辆
    @GET("/plant/archive/getInitialInspectionCar")
    Observable<Response<VehicleInspection>> getInitialInspectionCar(@Header("token") String token, @Query("carPlate") String carPlate);

    //仓储按车牌获取待初检车辆
    @GET("/plant/storage/primaryInspection")
    Observable<Response<StorageVehicles>> primaryInspection(@Header("token") String token, @Query("carPlate") String carPlate);

    //初检
    @FormUrlEncoded
    @POST("/plant/storage/primaryInspection")
    Observable<Response> postprimaryInspection(@Header("token") String token, @FieldMap Map<String, String> maps);

    //内场档案二验
    @GET("/plant/archive/recheck")
    Observable<Response<Recheck>> recheck(@Header("token") String token, @Query("carCode") String carCode);

    //车辆二验
    @FormUrlEncoded
    @POST("/plant/archive/recheck")
    Observable<Response> addEntranceCar(@Header("token") String token, @FieldMap Map<String, String> maps);

    //车辆库位
    @GET("/plant/storage/carMove")
    Observable<Response<VehicleLocation>> carMove(@Header("token") String token, @Query("carCode") String carCode);

    //车辆移库
    @FormUrlEncoded
    @POST("/plant/storage/carMove")
    Observable<Response<VehicleLocation>> PostcarMove(@Header("token") String token, @Field("carId") String carId, @Field("warehouseId") String warehouseId);


    //入库
    @Multipart
    @POST("/plant/archive/carEntrance")
    Observable<Response> carEntrance(@Header("token") String token, @Part ArrayList<MultipartBody.Part> file);

    //车辆初检
    @GET("/plant/archive/carEntrance")
    Observable<Response<carEntrance>> postcarEntrance(@Header("token") String token, @Query("carId") String carId);

    //退车
    @FormUrlEncoded
    @POST("/plant/archive/carReturn")
    Observable<Response> carReturn(@Header("token") String token, @Field("carId") String carId, @Field("remark") String remark);

}
